<?php

namespace app\backend\controller;
use app\backend\model\Config;

class SysAudit extends Admin
{
    public function index()
    {
        if (!$this->request->isAjax()) {
            $res = Config::where([
              "name"=>"audit_statu"
            ])->find();
            $this->view->assign('info', $res);
            return view('index');
        }
    }

    public function update()
    {
        $data = $this->request->param('data', '', 'serach_in');
        Config::where([
            'name'       => "audit_statu"
        ])->update([
            'data' => $data
        ]);
        return json(['status' => '00', 'msg' => '保存成功']);
    }
}